1. Field of the Invention
The present invention relates to a moving picture encoder, and more specifically to the detection of a scene change in the preprocess of an encoding process, the control of the amount-of-information allocation, and the control of the initialization of a rate control parameter related to the detection.
2. Description of the Related Art
Recently, with the progress of encoding technology, etc., it has become widespread to process image data as digital data, store the data of a static image and a moving picture in an optical disk, a magnetic disk, etc. using a digital signal, and regenerate a high-quality image. In the transmission system, services of a digital television telephone and a digital broadcast have been started. Thus, since the amount of image data is considerably large to process image data as digital data, it is necessary to efficiently encode and compress the image data.
FIG. 1 shows the rough concept of the moving picture encoder for encoding a moving picture. The moving picture encoder is provided with an encoding unit 300 for practically encoding a moving picture, and a preprocessing unit 200 for extracting information for use in encoding an original image by an encoding unit 300 before the encoding process.
In encoding a moving picture, the amount of coding information for each frame is compressed not only based on the correlation between pixels in a frame, but also based on the correlation between frames. For example, as shown in FIG. 2, each frame of an original image is classified into an I frame (key frame, I picture) which is an absolute standard of the difference between frames, a P frame (predictive-coded frame, P picture) whose difference from the previous frame is encoded, and a B frame (bi-directionally predictive-coded frame, B picture) for encode based on the pixel information about the frames in two directions, that is, the previous and subsequent frames. In the example shown in FIG. 2, a group of pictures (GOP) is formed by 12 frames. The preprocessing unit 200 determines the picture types of I, P, and B.
Also in encoding an original image, it is known that when a scene change occurs, it is detected and the leading frame of the subsequent scene is defined as an I frame, that is, an I frame is inserted. This means that there is an important correlation between the frames in one scene while there is a less important correlation when a scene changes, and the amount of data required in the coding does not greatly change between encoding a difference from the previous frame and encoding as a single frame, or the difference cannot be sufficiently encoded, thereby degrading the quality of an image. As described above, if an I frame is inserted when a scene change occurs, then the occurrence of the scene change is also detected by the preprocessing unit 200.
In encoding of moving pictures, I-frame is inserted when a scene change occurs. If scene changes frequently occur in the range of a predetermined amount-of-information allocation, the amount of information allocated to an encoding process on I-frame becomes enlarged. Therefore, the amount of information cannot be sufficiently reserved for another coding, thereby considerably degrading the quality of an image. Thus it is necessary to prevent the degradation of the quality of an image although scene changes frequently occur.
The patent documents 1 and 2 listed below describe the technology of detecting a scene change. The patent document 1 describes the technology of detecting a change of a scene in order to edit a moving picture recorded on a video tape. The patent document 2 describes the technology of determining the moving picture characteristic common to a frame group having the same scene, and collectively amending an image based on the determined characteristic.
The patent documents 3 and 4 describe an image obtained by performing pull-down transformation on a film of movies and a related encoding process, and also describe the scene change detection. Furthermore, the patent document 4 describes the bit allocation for use in an encoding process.
FIG. 3 shows an example of misdetection of a scene change when a scene change detecting process is performed based on an amount of time change of a summation of absolute differences (SAD) between frames which use the same data in a plurality of frames in performing a process of animation, pull-down, edit, etc. When there is a static image screen, the amount of time change of SAD is large although a scene change does not occur, and there is the possibility of misdetection of a scene change.
When the same data is also used in the processes of animation, pull-down, edit, etc. (when the time axis is not even), there is the possibility of an occurrence of misdetection of a scene change. So, it is necessary to prevent the misdetection of a scene change.
Briefly described below is amount-of-information allocation for encoding and rate control performed in encoding a moving picture. To monitor and control the amount of information required in encoding a moving picture, it is assumed that encoded data is input to a virtual VBV (video buffering verifier) buffer. The VBV is a virtual decoder conceptually connected to the output of an encoder. The encoder has to output a bit stream, preventing the overflow or underflow of the VBV. The required range of the VBV for a generated amount of information depends on each encoding standard.
FIG. 4 shows an example of a change with time of an amount of occupation of a VBV buffer indicating the occupation of the VBV buffer when the next frame is encoded. Therefore, since VBVmax refers to a maximum available buffer, it means that the buffer is available, and “0” means that there is no available space in the buffer.
The amount of occupation of the VBV buffer, that is, the remainder in the VBV buffer, is considered for the amount-of-information allocation for encoding and the rate control. The amount of encoding information is allocated for each GOP, and the amount of information is allocated to the frame in the GOP in the range of the allocation.
[Patent Document 1] Japanese Published Patent Application No. H09-130732
[Patent Document 2] Japanese Published Patent Application No. 2002-152669
[Patent Document 3] Japanese Published Patent Application No. H10-145779
[Patent Document 4] Japanese Published Patent Application No. H10-304379